<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>测试机申请</title>
<import file="js.My97DatePicker.WdatePicker" />
<import file="js.jquery" />
<import type="css" file="css.workform" />
</head>

<body>
<form action="__URL__/sign_insert" method="post" name="form1" onsubmit="return CheckForm();">
  <div style="width: 725px;margin: 0 auto;text-align: right;padding-bottom: 10px">
    <span style="width:725px;text-align:right;">直属销售: <input type="text" size="10" name="higher" class="BigInput apply" value="{$data['higher']}"></span>
  </div>
  <table align="center" border="0" width="725" cellpadding="2" cellspacing="1" align="center" bgcolor="#000000" class="TableBlock">
    <tr>
    	<td class="TableContent">申请人</td>
    	<td class="TableData"><input type="text" name="apply_username" size="23" class="BigInpu apply" value="{$data['apply_username']}" ></td>
    	<td class="TableContent">申请日期</td>
    	<td class="TableData"><input type="text" name="apply_date" size="23" class="BigInpu apply" onClick="WdatePicker()" value="{$data.apply_date}" ></td>
    </tr>
    <tr>
     <td nowrap class="TableContent"> 设备类型：</td>
      <td class="TableData" nowrap colspan="3">
        <input type="radio" name="type" value="1" <if condition="$data['type'] eq '1'">checked</if> >统一安全管理与综合审计系统&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="radio" name="type" value="2" <if condition="$data['type'] eq '2'">checked</if> >数据库审计系统
      </td>
    </tr>
    <tr>
     <td nowrap class="TableContent"> 产品型号：</td>
      <td class="TableData" nowrap colspan="3">
        <select name="model" style="width: 180px;" class="apply">
      		
      	</select>
      </td>
    </tr>
    <tr>
      <td nowrap class="TableContent"> 功能需求：</td>
      <td class="TableData" colspan="3">
        <textarea rows="4" cols="50" name="demand" class="apply">{$data.demand}</textarea>
      </td>
    </tr>
    <tr>
      <td nowrap class="TableContent"> 客户名称：</td>
      <td class="TableData" colspan="3">
        <input type="text" name="client_name" size="64" value="{$data.client_name}" class="BigInput apply" >
      </td>
    </tr>
    <tr>
      <td nowrap class="TableContent"> 合作伙伴：</td>
      <td class="TableData" colspan="3">
      	<textarea rows="4" cols="50" name="partner" class="apply" >{$data.partner}</textarea>
      </td>
    </tr>
    <tr>
      <td nowrap class="TableContent"> 测试地点：</td>
      <td class="TableData" colspan="3">
        <input type="text" name="place" size="40" value="{$data.place}" class="BigInput apply" >
      </td>
    </tr>
    <tr>
      <td nowrap class="TableContent"> 预计归还时间：</td>
      <td class="TableData" colspan="3">
        <input type="text" name="back_time" size="23" class="BigInput apply" value="{$data.back_time}" onClick="WdatePicker()" >&nbsp;&nbsp;共计借测&nbsp;&nbsp;<input type="text" name="back_weekly" size="4" value="{$data.back_weekly}" class="BigInput apply" >&nbsp;&nbsp;周
      </td>
    </tr>
    <tr>
      <td nowrap class="TableContent"> 申请原因：</td>
      <td class="TableData" colspan="3">
        <textarea rows="4" cols="50" name="reason" class="apply" >{$data.reason}</textarea>
      </td>
    </tr>
    <tr>
      <td nowrap class="TableContent"> 负责人签字：</td>
      <td class="TableData" colspan="3">
        <label><input type="radio" name="higher_audit" value="1" <if condition="$data['higher_audit'] eq 1" >checked</if> >同意</label>
        <label><input type="radio" name="higher_audit" value="0" <if condition="$data['higher_audit'] eq 0" >checked</if> >否决</label>&nbsp;
        	原因：<input type="text" name="higher_sign_reason" size="34" value="{$data.higher_sign_reason}" class="BigInput sign" >
      </td>
    </tr>
    <tr class="TableControl">
      <td nowrap colspan="4" align="center">
      	<input type="hidden" value="{$action}" name="action" >
      	<input type="hidden" value="{$data.id}" name="id" >
      	<input type="hidden" value="{$data.status}" name="status" >
      	<input type="hidden" value="{$data.dept_id}" name="dept_id" >
      	<input type="hidden" value="1" name="way" >
        <input type="submit" value="保存" onclick="changeway(1)" class="BigButton">&nbsp;&nbsp;&nbsp;
        <input type="submit" value="提交" onclick="changeway(2)" class="BigButton">&nbsp;&nbsp;&nbsp;
      </td>
    </tr>
    </table>
</form>

</body>
<script type="text/javascript">
$(document).ready(function(){
	$(".apply").attr('readonly',true);
	$(".apply").css("background-color","#F2F2F2");
	$("input[name='type']:radio").change(function(){
		checkradio();
	});
	checkradio();
});
function changeway(value){
	$("input[name='way']").val(value);
}

function checkradio(){
	var type = $("input[name='type']:radio:checked").val();
	if(type == undefined){
		return false;
	}
	var model = "{$data.model}";
	$.getJSON("__APP__/Device/gettype?type="+type,function(result){
		$("select[name='model'] option").remove();
		$.each(result, function(i,value){
			if(value.id == model){
				$("select[name='model']").append("<option value='"+value.id+"' selected>"+value.name);
			}else{
				$("select[name='model']").append("<option value='"+value.id+"'>"+value.name);
			}
		});
	});
}
</script>
</html>